home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: argc/argv & switches
- Date: 07 Mar 1996 00:47:52 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Mar6174753@qcd.lanl.gov>
- References: <4h2j8j$9gn@milo.freenet.vancouver.bc.ca> <danpop.825593142@rscernix>
- <313E0094.167EB0E7@fore.com>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: Jeff Rosenfeld's message of Wed, 06 Mar 1996 16:16:04 -0500
-
- In article <313E0094.167EB0E7@fore.com>
- Jeff Rosenfeld <jeffro@fore.com> writes:
-
- JR: Dan Pop wrote:
- JR: > Note that *++argv[0] is technically incorrect, because there is no
- JR: > guarantee that argv[0] can be modified by the program, it can be legally
- JR: > stored in a read only memory segment.
- JR:
- JR: Not so. The standard mandates that if main is defined with two
- JR: parameters (which we'll call argc and argv), then:
- JR:
- JR: The parameters argc and argv and the strings pointed
- JR: to by the argv array shall be modifiable by the program....
- JR:
-
- Not so. argv[0] is neither argv, nor a string pointed to by the argv
- array. It is a pointer to the first character of a string pointed to
- by the argv array.
-
- Thus argc, argv, **argv are all modifiable, but not necessarily *argv.
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-